<!DOCTYPE html>
<html>
<head>
<title>用户登录-速订客</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<meta name="keyword" content="">
<meta name="description" content="">
<link rel="stylesheet" rev="stylesheet" href="<?=STATIC_URL;?>css/base.css" type="text/css">
<link rel="stylesheet" rev="stylesheet" href="<?=STATIC_URL;?>css/reglogin.css" type="text/css">
<link rel="icon" type="image/x-icon" href="<?=STATIC_URL;?>favicon.ico">
<link rel="shortcut icon" type="image/x-icon" href="<?=STATIC_URL;?>favicon.ico">
</head>
<body>
<?php include dirname(__FILE__).'/../com-header-sample.tpl.php'; ?>
<!------------------------------------>

<div id="container">
<form name="submitForm" method="post" action="/login/done" id="submitForm">
  <div class="cb win900">
    <div id="conleft">
      <div id="login-welcome-bg"></div>
    </div>
    <div id="conright">
      <ul class="login-scrool">
        <li class="hover" onclick="setTab('scrool',1,2,this)" id="scrool1"><em></em>账户登录</li>
      </ul>
      <div class="scrool-bg">
        <div class="loginbox">
          <?php if(isset($error) && $error) { ?>
          <div id="tipDiv" class="sc">
            <div class="mid mid-t1">
              <div id="errorTip" class="conn">用户名或者密码错误</div>
            </div>
          </div>
          <?php }else{ ?>
          <div id="tipDiv" class="sc" style="display:none;">
            <div class="mid mid-t1">
              <div id="errorTip" class="conn"></div>
            </div>
          </div>
          <?php } ?>
          <table>
            <tr id="usernametr">
              <th>账户名</th>
              <td><input class="inp" type="text" id="username" name="username" onfocus='if (this.value == "用户名/电子邮箱") this.value = "";this.className = "inp inw";' size="20" value="用户名/电子邮箱" /></td>
            </tr>
            <tr id="mobiletr" style="display:none">
              <th>手机号</th>
              <td><input class="inp" type="text" id="mobile" name="mobile" onfocus='if (this.value == "手机号") this.value = "";this.className = "inp inw";' size="20" value="手机号" /></td>
            </tr>
            <tr id="passwordtr">
              <th>密　码</th>
              <td style=" padding-bottom:5px;"><input class="inp" id="password" type="password" style="margin-bottom:7px;" name="password" size="20" onpaste="return false" value=""/></td>
            </tr>
            <tr>
              <th>&nbsp;</th>
              <td style="padding: 0pt;"><input type="checkbox" style="vertical-align: middle;" id="coks" value="on" name="remember" />
                <label class="logintip" for="coks">下次自动登录 (公共场所慎用)</label></td>
            </tr>
            <tr>
              <th>&nbsp;</th>
              <td style="padding:0;"><span class="butt" style="line-height:34px;">
                <input type="submit" name="dosubmit" value="登录" class="btns" accesskey="l" id="btnSubmit" />
                </span><span class="reg-a"><a href="/reg">免费注册</a>|<a href="/reg/forget">找回密码</a> </span></td>
            </tr>
          </table>
        </div>
        <div class="link-login" style="display:none;"> <span class="lots">使用合作网站账号登录：</span> <a class="loico" id="lo_sina" title="新浪微博用户登录" href="/sinalogin?path=http://dl.58.com/?pts=1338965798812">新浪微博</a> <a class="loico" id="lo_qq" title="QQ用户登录" href="/qqlogin?path=http://dl.58.com/?pts=1338965798812">QQ</a> <a class="loico loico-b" id="lo_kxw" title="开心网用户登录" href="/kxlogin?path=http://dl.58.com/?pts=1338965798812">开心网</a> <a class="loico " id="lo_139" title="139邮箱" href="/mail139login?path=http://dl.58.com/?pts=1338965798812">139邮箱</a> <a class="loico" id="lo_renren" title="人人网用户登录" href="/renrenlogin?path=http://dl.58.com/?pts=1338965798812">人人网</a> <a class="loico loico-b" id="lo_msn" title="msn用户登录" href="/msnlogin?path=http://dl.58.com/?pts=1338965798812">msn</a> </div>
      </div>
      <!--scrool bg-->
      <div class="clear"></div>
    </div>
    <div class="c"></div>
  </div>
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<?php include dirname(dirname(__FILE__)).'/com-footer.tpl.php';?>

<script type="text/javascript" src="<?=STATIC_URL;?>js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
function showError(err){
    $("#tipDiv").show();
    $("#errorTip").html(err);
}
$(document).ready(function() {
    $("#username,#password").focus(function(){
        $("#tipDiv").hide();
    });
    $("#submitForm").submit(function(){
        if($("#username").val() == ""){
            showError("用户名没有填写");
            return false;
        }else if($("#password").val() == ""){
            showError("密码没有填写");
            return false;
        }else{
            $.post("/login/done", {isajax: 1, username: $("#username").val(), password: $("#password").val()},
                function(html){
                    if(html!=1){
                        showError('用户名或者密码错误');
                        $("#password").val("");
                        return false;
                    }else{
                        location.href="/";
                    }
                }
            );
            return false;
        }
    });
});
</script>
</body>
</html>